/***
 * 单元管理Api
 */
import request from "@/utils/request";

let village = '/service-village'

/**
 * 条件查询单元信息
 * @param query
 * @returns {AxiosPromise}
 */
export function queryUnit(query){
  return request({
    url: village + '/village/unit/queryUnit',
    method: 'get',
    params: query
  })
}

/**
 * 修改单元信息
 * @param unit
 * @returns {AxiosPromise}
 */
export function updateUnit(unit){
  return request({
    url: village + '/village/unit/updateUnit',
    method: 'post',
    data: unit
  })
}

/**
 * 新增单元
 * @param data
 * @returns {AxiosPromise}
 */
export function addUnits(data){
  return request({
    url: village + '/village/unit/addUnit',
    method: 'post',
    data : data
  })
}


/**
 * 删除单元
 * @param id
 * @returns {AxiosPromise}
 */
export function removeUnit(id){
  return request({
    url: village + '/village/unit/removeUnit/'+id,
    method: 'delete'
  })
}
